fixed compatibility issues with WP 4.0

* due to non-compatibility issues with WP 4.0, complete rewrite of the
plugin from the ground up
* bump minimum required WP version up to 3.8