Add tests, rework directory structure