Progress with authentication, relates to issue #44
- Moved auth to common
- Added jsdoc