native code generator: Use groups for constructors too.

Change-Id: I42570b4b7b68e36cab1286948d03df0c2f0d4103
Merge these source files. Also move a function to where it's used.

Change-Id: Ia0378a58c63364a73c40dd901d93e20a596a4c29