Re-factored entire plugin

* refactored and optimised the entire plugin
* changed license to Apache License v2.0
* updated licensing and example options