Added interface for enumerating NT or terminal extensions to Trie

Includes efficient implementation for packed trie, and inefficient one for hash-based tries (including packed grammar top level trie, which likely just contains every single known terminal and NT).