Sort the module names so we no longer rely on implicit ordering. Fixes #391. Closes gh-392