Made trie generic and added rlp changes