find the correct name of the namevar

rather than relying on namevar always being name, we try to find the
correct one.

"of course", this will not work for composite namevars.

this addresses #1