Refactored to better match PHP coding standards.

I intentionally did not use a namespace so the plugin is compatible with a wider range of PHP versions.