Miscellaneous additions

Hopefully the commit messages explain the changes sufficiently.  If not, feel free to ask!