Added support for multiple users.
Changed some db stuff