Revised the message pump yet again; this method gives us the best of both worlds.