Rewrite misc.idl.json to HNI

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