Tidy up plugins and refactor to use pygame events and loop.