Add trie definition and insertion method

Updated the tests for a more simplified version and add code to
cover them.