Added TwoStageThresholding (tst.py), with tests and example phase transition