Switching to app component startup model.

-Fixed some bugs in router.