Refactor to make the backends use the new history facility