refactored server code to have more consistent style

and cleared out some legacy code from angular-passport