Cache fix

This addresses an issue that @wdwvt1 in which caches were not being invalidated correctly. In addition, better support for lookups on internal nodes are provided, and this better matches the existing behavior of cogent's `getNodeMatchingName` method which would return the first instance of a found node regardless of if the internal nodes had duplicate names.