Fix multiple issues relating to the startup process

Fix multiple instances of SG being able to start
Fix garbled text appearing during startup in console
Fix startup code order and general re-factoring (adapted from midgetspy/Sick-Beard)