Fix some bugs to make Mantra work without the GUI
Add mantrascript.py