Refactored out JSON parsing to a class, added unit testing for the class