Add an `InvalidNodeType` constructor to the `NodeError` type
This aims to deal with cases where the `typename` field of the `nodes` table does not correspond to a valid node type. The new constructor has an Integer field to indicate what the stored invalid type name ID was. The related machinery was updated accordingly.