Refactor attribute accessors

This PR aims for a complete refactoring step in the abstract
shell surface API code, aiming for a big removal of code there
in favour of some abstraction.

PR #625 prepares for the next few steps I want to do here,
to refactor the attribute writing into one API call here.

Blocked by #625.
If `res != 0`, `ident` is not `free()`d. You may fix this by simply moving the `free()`-call _above_ the if.