add serialized-size function to core

Also, associated getter in PersistentProtocolBufferMap