Initial commit of plugin code.
Added plugin.api.envelope hook