Change k/v logging to use maps.

Makes the code just a tad more readable.