Fix a bug where constructor names were omitted.

With the new AST factory functions, constructor names were omitted in
some cases.

Also, move the generation of names around so it matches the old code.
It's somewhat arbitrary, but this makes the diff between old and new
consistent.  That's obviously not a great reason going forward, but it
doesn't matter too much either.