Added implementation and tests for writing padding metadata blocks.