Restructured the project and added unit tests.