Fixing generated names

This pull request contains two commits.

The first commit reorganize the code that generates names and verilog text
while preserving the previous textual output.

The second commit introduces the following fixes:
 * remove duplicate modules that are logically identical
   but textually different
 * suffix first component which is part of a set with _0 following
   convention for other components in that set.