Fixes support for replacer functions. Closes #529
Corrects JSON test to evaluate all tests.
Merge #530 r=@tcr: Fix JSON replacer function and test scripts.

This function was completely broken, my bad.