Rename 'type' key to 'name'; cleaner tree printing

The 'type' key conflicts with Lua's 'type' function. I think the key is
valid, but is more likely to be confusing as part of code. For example,
I suspect a literal like '{type = 3}' may technically not be valid,
although it seems my Lua interpreter accepts it. In any case, the syntax
highlighting was wrong and it is human-mind-confusing, so I changed it.