fix for NameError on library loads on Linux

Added a lexical sort to the loop including libraries, so funky OS file sorts don't trip loading.