Implement simple token-based authentication

Tokens are stored in a tokens table so that they can be used to lookup user as part of the authentication process.

At the moment there is no token expiry so we would need to clean out tokens or expire them after a period of inactivity.