convert to plugin project and add some tests