handle writing JS values from other JS Contexts

New option for transit writers - "handlerForForeign". If provided an
handler cannot be found for a value this function will be invoked
being pass the unhandled value and the map of installed handlers. This
should function should return the correct handler.

Supplying a "handlerForForeign" implicitly also installs detection
of plain Objects from foreign JS contexts.