Reorganize for better testing and distribution