Change global variable to be prefixed with a g_

This changes brought the need to update format.py and in turn the test
suite for this moduel. The main emperor file was updated accordingly,
most of the bigger changes happened here:
    - Removed unnecessary variables
    - Grouped global variable declaration and descriptions
    - Update code accordingly
    - Minor random format fixes to the file