Added JSON serialization support & tests for advanced math functions.