Started working on the Plugin API

I’m still experimenting..
Added more docs