Move service implementation code under rethinkdb so we can create a
cache interface. Implement cache interface.