Changes to implement Passport.js for local authentication.
Code refactoring