add .type to all nodes. Closes #18