Add JSFunctionWrapper in preparation for bindings-generator changes.

This adds an implementation of JSFunctionWrapper, which is used by this bindings-generator PR:

https://github.com/cocos2d/bindings-generator/pull/16

The JSFunctionWrapper adds roots to a JSObject and jsval for the lifetime of the wrappers.  The intended use is something like this:

std::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, jsthis, jsfunc));
auto lambda = [=]() -> { func.invoke(...) }

The lambda captures the shared_ptr by value, so the lifetime of the wrapper (and JS root) is tied to the lifetime of the lambda.