add get_software_libdir function to modules.py, along with unit tests

this contains the working part of #754