Put app initiation code in window.onload