refactoring json stuff
json parser bugfixes. i/o lib now passing tests.