Fixed user creation and registration. Began big refactoring.