moved tests to test project, modified json parsing to be more robust