[#6431] don't rely on bool(cursor)

* bool(cursor) is not good either
* refactor some attachment methods up to (Versioned)Artifact
* User.withskill len fix
17 files changed