merging all the fixes that were made in the decouple branch as well as
the RethinkDB 1.12 compatability changes