This replaces our boost function wrapper code with templated code.
Supported:
- Any number of argument, so long as they are convertible to/from JSVal (or are themselves JS::Values)
- Any return type, same criteria, including void
- Works with free functions and as object properties -> can use a custom "this" getter, so we can clean up things in a bunch of places (TODO: see ComponentManager)
TODO (maybe): - Optional arguments (aka some arguments are default-constructed no the C++ side)
- Can (optionally) pass the private context data as first argument transparently.
I need to check overloaded functions, I think it might be supported with a static_cast.