Extract common setup for application tests.
Fix tests to work irregardless of line endings.

The application uses platform-specific line endings - ensure that things
work no matter what platform we are on.