WIP... Tiny refactorings, but I just reinstalled Virtuoso and things look green, so I wanted a checkpoint. Heh.