Converted this to plugin code.
Separate platform-independant plugin project