Moved and slightly updated machine related classes from jaffas.