Moved key press logic from maininterface to a context manager, tidied some things up, and got push/pops working