Inject event mixin into window object and add a convenient dispatchNamedEvent method to document
Dispatch DOMContentLoaded event after OpenGL context setup completed
Use duk_pcall_prop instead to prevent crashing