Added open and close methods

This adds the File-style semantics that we all know and love, as well as the DSL-style that some people know and love.