Multiple patches

This combines a few of my pull requests into one non-conflicting one that should be easier to merge.  It also includes smaller changes that don't seem to warrant a pull request.

My queue patch isn't included because it doesn't conflict and is somewhat controversial...

I'd like to add user and channel mode saving, but that means rather complicated mode processing functions...