Extract handler functionality into separate file
dontQuit has no need to be a global variable
Merge pull request #3 from alphagov/refactoring

Some refactorings