Move some context definiions to contexts.py