Refactor all sandbox code to use promises

Still requires more testing, but so far things seem to work. Note that I haven't pushed the updated JavaScript and JSON repos yet, so language support for those two will be broken.