basic byte and numeric sort rebased and squashed

closes #387 and implements basic functionality of #219.