Extract command mode parsing and rangeutils into separate packages