Implement :sort and ranges.

:sort mainly serving as a way to test the ranges.