Theory of the oxygen-induced restructuring of Cu(110) and Cu(100) surfaces