Implemented a command and query-pattern for more easy webservice integration.

Also implemented basic authentication in the UserSessionCommandHandler.