big code cleanup + optimizations

o cleaned up the code in a big way (better functions, types, name, etc.)
o avoided destroying and recreating the parser on every json doc