Sort numerically.

Refactors sort method to make it testable and added tests.

Added number detection.

Closes #211
Merge pull request #222 from agrc/numeric

Sort numerically.