Fixed authentication bug
Refactored a fair bit and made sure to not allow re-registration of usernames