Extracted database interface and added methods to retrieve preferences from Mongo