Rewriting context in preparation for other changes

Changes:
- Context has been split into three classes to form a class cluster
- Interpreter code now builds Contexts using the new factory method