Tests refactored, project reorganized