(Node) Add property for indicating need for cache directory

Graph caching currently assumes that every Node will need a cache subdirectory if caching is enabled. In practice, though, many nodes can serialize their state directly to JSON and don't need a subdirectory created. This leads to a bunch of empty subdirectories in the cache.

I think Node's should be given a property (e.g. Node::usesCache()) which Node::serialize can use to decide whether the node's subdirectory is created.