new: wakeup.py and mi.py. put shared functions in mi.py