Some refactoring and cleanup of the Paul The Conqueror code which will be merged with prototype_alpha.