split into core, tests and example modules, add test