fixes #3: include `type` field in JSON serialisation of AST nodes

Fixes #3.