Revert app daemonization.

This patch reverts everything to 277d608