moved to new plugin structure

Fixes #4
adds tests

Fixes #4