[IMP] orm: improve api of methods changing env
 - _attach_env() becomes with_env()
 - sudo() is split into sudo() and with_context()