Update: Controller "init" is not always operating as expected and improve error printing.
The execute as init state needs to be run with the as init settings set.
The settings.mode needs to be set to run as a service.
(I am considering adding a new standard practice for programs to accept default objects that are passed to the appropriate function from any main().)
Cleanup the printing:
- Using "print" rather than "output" (because it is shorter and "print" is already being used in some places for this).
- Get rid of one nesting level to further simplify the code using return (and avoid an extra operation from the "!").
- When exiting due to an interrupt, do not print an error message.