Add tests for encodings of objects to Space keys, hashes, and objects.
Fix implementation of Array#to_space_object to match spec.