Gmode.py

Gmode.py is the main class.