Encode map entries using std::pair specialization

Now that const values can be encoded we can use the std::pair logic.