Reorganize application boot process.

Signed-off-by: crynobone <crynobone@gmail.com>