Add ranges to testmachine.
range and delete support in testmachine. fix bugs this uncovers