Added all basic functionality for the plugin. Thoroughly untested.