Add # as an optional prefix to type selectors to allow better syntax in
some cases.
Fix a regression in multilevel complex selectors.
Add a node cache to improve performance of type and wildcard queries.