Refactored parser error code

As discussed in #208, I've refactored the tests that check for parser errors, such that they work for all json backends, but only catch the parse error specific to that platform.