Sort machine names as numbers where appropriate.
Test that machine names can be sorted as numbers.
Fix sort issues when comparing against strings.
Merge pull request #562 from huwshimi/sort-numbers

Sort names by number

Fixes bug #1369794: if machine names are numbers then sort them as numbers.