Make TrieMap Serializable

This implementation simply puts the content of the TrieMap into a
HashMap and serializes that

Signed-off-by: Moiz Raja <moizr123@gmail.com>