Initial commit of working plugin

All files plus demo.