Add test_app
Add packaging and flake8 config.
Better logging and don't cache configuration at the module level.
Add test cases.