Measure segmentation

First attempt at measure segmentation.  It works other than a few errors in measure detection.