Sort names by number

Fixes bug #1369794: if machine names are numbers then sort them as numbers.
I was kind of banking on this being forgotten about when we add real names for machines, happy to change this to something shorter in the mean time.