Finish the authentication middleware
Changed the bcrypt module to one that works better, tided the code and added documentation to most methods. Authentication is now fully working.