Rudimentary refactor to abstract (mostly) mongodb out. The only exception is the query language used by clients right now is dependant on the underlying db.