chore: remove __common.h

Break up the headers into each level of dependency.
feat(block): switch blockid type to sha1_digest

The type involves no dynamic allocation, and is short enough to be
used on stack.

Optimize the URL building routines to save possible reallocations,
and to make use of GCC's packed string literal optimization.