Added a Z angle optimisation function to ToolBox.py.

In ToolBox.py:
- added a function which finds the optimal Z angle of rotation
- replaced the old 'starting Z' finder in Perform3StepAlignment with this

More details:
The old 'starting Z' finder used to step through -1 to +1 degrees,
calculating the metric every hundredth of a degree. This takes 200-300
(and more?) seconds per iteration - current code uses two iterations.
New minimize code takes around 60 seconds the first time, then 30 seconds
the second time.

I checked the results of the alignment when using the old and new Z finder.
I looked at three runs from three different sensors, all results are compatible.
For two runs the new Z finder produces a marginally better result, for one run
it's slightly worse. I think that on the whole, resolutions are equivalent and
the new Z finder is much quicker. Also possibly more robust, as the Z angle
could be outside the 1 degree limit and would still be found, unlike before.