Exponential laws for topological categories, groupoids and groups, and mapping spaces of colimits