Added a separate class for the character and separated out functions for accessing the database / gridfs. Also general cleaning and reordering