Merge pull request #1 from kevin-brown/master

Catching up
Attempt to fix restarting using boolean flags
Moved restarting to a seperate function.
Added RestartThread: Fixes infinite restarting loop
Merge pull request #2 from Express50/master

Restarting implementation