Major refactor to expose functionality as simple middleware. Reworked all tests
Add validation on email and password. Support using validation with and without flash. 1 test failing
Refactored tests to be able to test behaviour when no flash
remove dumb code
Add support for session-less reporting of login errors
small fixes
small fixes
refactor
remove old code
minor changes I forgot to commit. loginPath needed for the /unregister and /changepassword parts of registration
Rename hash & verify funcs to not be password specific (using them for tokens in registration module)
Add logging
Get rid of old loginView handler
Make res.locals.error an array (to match value if getting from flash) and rename to errors
configure npm to run tests