implemented classes to follow the jansson memory management scheme.  added more TODOs