Added encryption and changed from Monk to Mongoose

I added server side encryption through the bcrypt library that
hashes passwords before saving to the database. Also since Mongoose
automatically enforces validation, and Monk is not as widely used,
I decided to switch the database code from Monk to Mongoose.
With minor tweaks all of the current tests work as expected.
Fixed tests and added more tests
Abstracted out socket factory
Abstracted login and user and message lists