Move machine routines to egg.py