Added unit tests for key-value stuff.