Switch to plugin annotations and fix a deprecation

(This also has some superfluous commits, but I didn't see any easy way to request pull for just 200cced and d8c03b8)