Adds sorting fix for node.js 0.8.

Under Linux (tested on CentOS 5.9 and Travis) fs.readdirSync gives results not sorted by name
thus we need to sort the list of matching files by ourselves.