Functional context passing refactor

Major functional context refactor of the JavaScript code; context is passed among the functions, rather than being stored on an Execution object.  This makes concurrency and order of execution much more resilient.