Fixed to_json for OpenStruct

https://www.pivotaltracker.com/story/show/49286499