some refactoring of parser code, better json output, updated tests