added sandbox-defun and sandbox-while from erbot
refactor for sandbox-defun