major cleanup of exception stack handling, stabilize prompt detection in multithreaded apps

there are some major snafus on exception *output*, but at least we get the
bright stack now (mostly)