General improvements

A collection of improvements for the plugin as a whole. I committed each change separately, so you can work through them easier.