Padding now performed only where needed.

This improves testability and readability.
Also, the old padding structure wasn’t always appropriate, so many
places needed to restructure the data before it could be used.