Added functionality to cut out unlinked nodes

This is done using the -x flag and simply sets each node.linked
depending on whether the node is linked. node.visible is then set
depending on whether it is linked.

The reason for not simply using node.visible is because when specific
types of node are excluded this is what will be used - setting
node.linked is a little clearer