Add configurable sorter. Closes #145.