Add transaction type

Targets #191
Just do `t->name = getref(name);`. It does the casting and performs a nullcheck.