Refactored base plugin class

- New code will reduce the clash with JavaScript files used by other plugins.