Factored out the closure parameter to JsFunction.

Real closures are now used. The closure types that were already created are now also used to create the methods that use the closure as instance methods. CreateFunction now takes a delegate that has the closure as the target reference.