added a script to process JSON file term

also added all supporting functions. Have not tested it. Dunno if it
works.