Refactor server.js and implement naive auth

Authentication implementation using passport and passport-local.