Restructured codebase. WIP. Untested.