Python3 Update

Updated libgen.py and modgen.py to work properly with python3. Also made the scripts directly executable using /usr/bin/python (assuming python3 is installed as python).