Add error message when calling `remove_node` on a group

The current error message returned when calling `remove_node` on a group is not really helpful.

This also add some unrelated testing for `is_dict_node`. (It came up while debugging.)