Changes and fixes to mainpage.py such that exe builds on mac osx