Convert system/idl/function to HNI

Convert system/idl/function to HNI.
Also fixes compatibility with PHP, when func_get_arg() is called with non-integer parameter.

Part of https://github.com/facebook/hhvm/issues/1480.