Various improvements, see commit log for details

It looks like there are already pull requests for two of the commits I did (bf6bef9 and c135236), so feel free to ignore those and grab the changes from @dhowden instead.