Start of refactor partially done.
Now some issues:
1. the find tests are broken
2. logging is broken
3. More fine-level details have to be corrected, like who should access who and what should be private in each new module.