Some more tests, code re-org