Sort names by number

Fixes bug #1369794: if machine names are numbers then sort them as numbers.
So we pad the string out e.g. '000new1', where if we wanted the strings that include numbers and strings to sort correctly we'd have to do something like 'new0001'