Transforms the compile plugin into the new style (function instead of cl...

...ass).

This PR also introduces call to lifecycle functions (before and after render) in the plugins should they exist. It is a temporary solution since this will become part of the plugin definition in the plugins.js file further down the road. As for now though it ensures that we can cater the same functionality as previously done in the old style of plugins.