Clean up ApplicationMain, preloader fixes for Flash target