added Application.beforeInit() and made Application's callback optionally asychronous