Quoting, safety of test, exports.

* More intuitive (and safe) test for MESOS_HOME.

* Ensure MESOS_HOME is exported.

* Quote variables and process substitutions for safety.

* Expand `$@` inside quotes to ensure arguments with spaces are handled.