Added Context class and tests