Updated castep optimise scripts.  More robust and support logging.