TGT-1001 and earlier stuff

The title defaulted to blank for this pull request, which I believe was because there were several previous commits in the fork that had not yet been merged into dnuttle.