Closure Library
Creates and returns a new function with the exact same behaviour as fn.
clonefunction(fn: function): function