Cleaned up data access api

Changed API structure to use collection names with actions and added
dependency injection into data layer in order to make it easier to use a
test database.