Revise how context (sandbox) is handled.

This implementation is more in line with REPL.