Setup environment when launching a plugin.

Also, convert ResampleScalarVolume to use the dynamic environment.