Move RethinkDB query builder into model classes