First pass at a trmon command-line interface; fix a few bugs