User settings

This is a pull request for issues #455 and #456.

> So, we only need to check if user is logged in and if username is already set. This line will actually throw the same error in both cases. I'll split it into two errors and take care of that race condition.

No need necessary to throw an error. In some other methods (like permissions) we simply return number of documents changed. If conditions do not match, then 0 is returned. Otherwise 1.