Middleware now sets mojito-debug property in req.globals in order to indicate that debugger is enabled and to give access to the original url. Using addEventListener to listen to the application's onload event. Calling done outside the toggle transition since it doesn't seem to be called in firefox.