STYLE: Extract module dependency code to a separate file.

For maintenance purpose.

Change-Id: I018bcacd91850b0905c497fdbf8ebf4548a787fc
Merge topic 'ImprovingCustomizingModules'

831d6a7 STYLE: Extract module dependency code to a separate file.