RubyClient: Fix bug in to_hash - need to explicitly serialize to string

 - avoids depending on json gem version for serialization
 - Fixes #239