Added static tility for (de)serializing KeyPAir objects, mainly for speeding up tests..