Streamlining

Made trie_node into trie as a nested class
Slightly reworked some operations