Make sure that Serializer->store_data always returns a value
Use byes::length instead of length for getting current position of the buffer

This really shouldn't matter, since the buffer should never be marked as
UTF-8, but it doesn't hurt to be careful.
Move metadata reading to a role so it can be shared with the database verifier