Allow the passing of a pre-created context. Cleaning up interfaces. Adding tests.