Add some context managers to dit.utils