Add context code support to exercises (optional)

Partial #52, fixes #49, fixes #46