Refactor main and move demonization and bootstrap to separate functions.
Refactor main and move demonization and bootstrap to separate functions.

bboozzoo/mender,bboozzoo/mender,ThomasRyd/mender,ThomasRyd/mender