Added metastate hashkey functions and test.