Make find_prefix/2 and find_prefix_longest/2 also work for btrie

I moved these two functions to trie.hrl and used some macros to make it work for btrie.