Add some features/improvements

Pretty self-explanatory.  Each change is in a separate commit so you can pick which ones you want to merge and which ones you don't like.