Removed redundant require (not sure why it was there twice)
Registration complete. Moved error messages and redirects to the session. Login and registration logic refactored into promises.