Major refactoring to use usernames as IDs and other stuff