Feature: Add support for 'helper' mode to compliment the 'program' mode.
This is a bug fix disguised as a new feature.
When controller runs in program mode and is cancelled, all background (asynchronous) processes are cancelled.
My original thoughts were that background processes should stay open in program mode.
This is the bug being fixed.
I believe that there are use cases to operate in "program" mode and to always terminate the background processes in this manner.
Rather than fixing one case and breaking the other, this is a new feature that helps solve both cases.
The "program" mode operates in the same manner unchanged.
The new "helper" mode operates by detaching background (asynchronous) processes on exit.
The foreground process still runs and blocks normally.
A terminate signal might still terminate background processes.
More work is likely needed in this regard.
This stretches the original design to its limits.
The 0.7.x versions and later will need re-design to better handle these cases.
The original design I used was a learn as I go for thread design.
This resulted in rather messy code.
Now that I made it to this point, the controller program (0.6.x and earlier) can be used as a stepping stone for a better design.
Some of the problems are worked-around.
The program starts and exits too fast in controller mode.
The child processes end up getting terminated before a complete process is started and then backgrounded.
The work-around is to add a short sleep.
This is not reliable but for most cases it should be fine.
Additional work-arounds may be needed by the user such as executig their own sleep foreground process.