Move math.idl.json to HNI

This pull request moves the functions in math.idl.json to HNI.

Part of #1480