Extracted Machine class from MachineSHopSimulator.  All tests pass.