more refactoring/modularization. give do_dsm a "handler", make curses display the default handler