Main application and tests.