Add a "type" field to all nodes represented as tables
Add node type assertions to test.lua