Moved selectAction() to event loop.
Improved debug function. Doesn't halt program anymore.
Changed from curses.LINES and COLS to window.getmaxyx(), and a small but necessary refresh().