import from mikeumus https://github.com/bevry/gostatic/issues/1#issuecomment-24488551
sort faster
rewrite
Merge pull request #5 from klml/master

import and rewrite from https://github.com/bevry/gostatic/issues/1#issuecomment-24488551