Add a bunch of new stuff that arbitrary code can use.
Fix all the problems in SafeExecute discovered in testing.