ENH/BUG: add context manager for expressions to auto-close resources
style changes for contextmanager test
replace dict.values indexing with toolz.first