Code cleanup and minor refactoring to improve maintainability and the ability to internationalise the app. Fixes #43