This also adds some validation to ensure the correct order of JS_Init, JS_NewRuntime, JS_DestroyRuntime and JS_ShutDown calls. Refs #3708 This was SVN commit r18584.