Refactor JavaScript runtime into a global object

This creates a single global Runtime object in the XBlock's window. The motivation is that a different container can redefine Runtime.handler_url if needed.