Improvement for ProtobufTranslator

* Fix N^2 in encoding (linear search of a map)
* IdentifyHashMap to make sure there is no regression or problem with redifined hashcode
* Comments on the implementation
* Formatting.