made the new transform() function backward compatible

transform() returns a context mgr class, but with __eq__ and __repr__
set to emulate the old usage where the function returned the current
transform mode (CORNER or CENTER)