main: restructured machine initialization.
main: machine can now be stopped using Ctrl-C.