Fix up directory structure and add tests.