General clean-up in the parser. Removed the commented DeclarationNode::name and added some helper functions to remove duplicate code.