adding context manager support

Mainly just enter/exit.  One slight change to _lofc().