Refactoring and user/identity enhancements

Refactoring of application to better support authentication and
identity.
Added support for user objects and roles.