refactoring to allow use from external modules
added e2e tests, using as external module
bumped to 0.0.4