Sort keys in state dump

Helps to manually compare the state output with other clients if needed.