A semigroup-theoretical view of direct-sum decompositions and associated combinatorial problems