Fix the sandbox so it works again

PREFIX wasn't set, 'which' wasn't using the env.sh environment, and
more.
Don't quote the path; spaces are literal in set
Initialize the plugin instances earlier

The quit method uses it and may be called before any are loaded.