Refactor things into multiple files
Remove main() from trie api
Reuse variables