You need  call mercury.app after document.body is loaded, otherwise document.body will be null and the app will not run