Significant refactor to move all code out of src/ and tests/ directories. All packages are in the top-level now, and tests are inside test/ sub-packages in the respective packages.