fix generate_software_list.py script, add unit test for it

This is only fixing and cleanup for the `generate_software_list.py` script, which is used to update https://github.com/hpcugent/easybuild/wiki/List-of-supported-software-packages after every release.

Added a unit tests too such that it keeps working as it should.