resize: Move roundup64 function into common utilities.

This is just code motion.
builder: Move is_block_device function into common utilities.

This is just code motion.
builder: Use a planner to work out how to convert the template to the final image.

The original template might be, say, xz-compressed raw of a certain
size.  We need to work out how to convert it to, say, qcow2 with a
larger size, in as few operations as possible.

Instead of using a nasty aggregation of special cases to do this, use
a breadth-first search over all possible trees to try to find an
optimal plan.

(Actually the current implementation isn't optimal, but it's fine for
virt-builder.)