Refactor code style of code creating test data
This patch proposes another code style to create module builds and associated
component builds. The major purpose to make this refactor is to make it easier
to follow up the lines of code and understand the test data and the
relationship between module builds and component builds.
Signed-off-by: Chenxiong Qi <cqi@redhat.com>