Fix for IronPython and types.FunctionType.

IronPython doesn't support types.FunctionType, which was used by the isomorphism code to make a deepcopy of a function.  We provide a workaround in the event that a NotImplementedError is raised. This workaround increases function call overhead slightly, so there may be some performance hit, but this has not been tested. #949 #1127.