Added tests, refactored project structure