fixed governor always tearing down buildings for cities and ports
factored out the replace buildings code

Signed-off-by: Stephen Lujan <StephenLujan@gmail.com>