Optimized HAMT and added tests for HAMT