Rewriting plugin for OOP

This plugin is being completely rewritten to be object-oriented.
Version 0.2.2 should be the last procedural release, barring any bugs
that need to be fixed before the rewritten version is ready. Once the
rewrite is finished, it will be released as version 0.3.0.