Separate all db ops from modulestore ops
Merge pull request #1333 from edx/dhm/separate_pymongo

Pull all db (mongo) functions into another file to enable easier replacement