Implement compact grouping

The grouping is realized as a set of identical elements over all BOM
which seem not to be a good idea, as elements are out of their
positional order.
Add refdes grouping

Add simple flat grouping of elements. This needs more testing,
especially edge cases.