Backport support for mainPreActions() in frontControllerApplication implementation, from http://download.geog.cam.ac.uk/projects/frontcontrollerapplication/