Removed the context manager functionality.

It's incompatible with the template method we're implementing next.
Merge branch 'feature/template_method'