fixing up tests for context and making things static functions