Convert to hash before json

This is causing an error with oj converting directly from a struct to json
Merge pull request #29 from aaronchi/patch-1

Convert to hash before json