Per @danielmewes, factor this into a separate function.
Move reql_version_t serialization to protocol_api.hpp.

Stuff other than the btree code needs this: for example, the HTTP
options.
Thread reql_version_t through all to_datum calls.