replace respects commutativity

Reported by Keaton Burns in https://groups.google.com/forum/#!topic/sympy/8wCgeC95tz0
`d = new.as_dummy()`