Cleaned up code, added group database retrieval.

Addressed some feedback, a majority of which was in userfsm.js
concerning promises. Changed some function names and comments.
Added a function to retrieve group profiles from the database.

* Cleaned up code
* Added group database retrieval