switched to json-pure from yajl-ruby to get jruby support and other clean up
DRY'up repeating code