JRuby Compatibility

WIP.

This gem was giving me issues under JRuby so I've decided to fix them. I've gotten the JSON output working but still have test failures.

I'm creating this PR to track the changes made.