Re-layers the application logic, removes type hints, adds tests.