Refactor code to use a more modular way of loading settings, this way we can re-use much of the same code in the different programs without resorting to very ugly hacks.