Distinguish between built-in and user-defined fns

When implementing functions from a module (e.g. `math` or `string`), the `key` for the `FunctionTemplate` is specified as the function.  In the case of the `math` module, the functions are of type `types.BuiltinFunctionType` while in the case of the `string` module they are of type `types.MethodType`.  The way that `context.get_function(...)` handles these has to be different, or the implementation is not found.