Evolution of a habitable planet: A biogeochemical modelling study of the rise of oxygen to modern levels