State machine builder.
Cleanup removes generated hex file.