No idea what has changed in this commit
Refactored database code, added comments and implement new getUser function