Minor fixes;

- Extract configuration to its own class.
- Handle StopIteration in Application to prevent it bubbling up too far; ultimately we probably want this to end the process.
-