Handle bug in bash 4.2 with tilde expansion

Pattern substituion in bash 4.2 was faulty, which caused tilde to not be
expanded in certain cases. This behaviour was previously relied on, now
we are only using that behaviour as a fallback on bash 4.2.

This resolves issue #289
Enable support for Software Collections

Fedora, RHEL, and CentOS provide support for multiple versions of
the same software components using Software Collections.  This
patch lists the active collections in a similar manner to Python
virtualenvs.