Major overhaul to range parser.