BUG-582: Sort modules on initialization

Rather than sorting them each time they are accessed, pay the price
upfront and create a sorted view of modules.

Change-Id: Ib8e02c930f936bf1354d1f7849a72ef8f8698625
Signed-off-by: Robert Varga <rovarga@cisco.com>