Add option to perform synchronous stopping of the cluster

This is necessary when writing automated scripts that stop and start the cluster.

My bash skills leave something to be desired - if there is a more elegant way to implement any of this, please let me know.