Generate abbreviated names for a list of strings.

This is useful e.g. for obtaining concise, unique identifiers
for target IDs that otherwise share a lot of verbose segments
in common (e.g. shared directory structure).

Auditors: benjy