Use a TaskTree.Node.Invalid instead of nulls

Previously nulls were used in the TaskTree.NodeList subnodes list to
indicate a special invalid use case, use a new TaskTree.Node.Invalid
class to indicate this. This change helps clarify the explicit invalid
case, but also makes unexpected NPEs during development less likely.
Since it is more obvious now when Nodes are invalid, go ahead and mark
invalid Nodes as cacheable for Branch filtering since they are
immutable.

Change-Id: I1551072ed2824a2d596060259d3da98b92abe04e
2 files changed