More refactoring. Basic RethinkDB support.