MathCoverageTest: encode test file using JSON instead of PHP serialize.

This ensures that changes to the test inputs or outputs yield readable
diffs when reviewing.

Change-Id: I7b4ef8102ad7fbf7c289a27db60f304a140b93a5