[Finished] Add user token authentication

This is the rebased version to clean up git commit history which got a little nasty. 

>This pull request allows the user to authenticate using the [JSON web token](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-31) standard.

>When a user authenticates via `/login`, he or she will receive a token which can be used for authenticating later requests. 

This should be ready to merge.