Add some tests, restructure (again)