Add context manager

This is for @jeanconn :smile:.  Please use this from now on.