Added json unit as a test dependency to allow easy testing of JSON equality ignoring array order
Further unit tests and javadocs. Changed illegal input to throw a checked Exception and added checks for disallowed input.