Implemented the as-yet-unused function iterate_ordered_by_version, used it in to_datum(grouped_data_t&&, ...).
Renamed to_datum(grouped_data_t&&, ...) to to_datum_for_client_serialization, added a menial reql_version_t parameter.
Made iterate_ordered_by_version pass the key and value separately.

This helps get around teh fact that std::vector and std::map use/expose slightly different std::pair types.