Perl 5.14 and 5.16 are failing
ignore carton files
wrap json parser in method

Wrap the JSON parser in a method so that we can override it for testing,
e.g. to sort keys.
enable keys to be sorted in test

I had an intermittent failure on this test because the JSON encoded
strings sometimes sorted keys differently.