Start porting the JavaScript context wrapper code to native JavaScript