Implement the 'require-sandbox' option.

Fixes #1596.