Changed formatOutput to use deterministic algorithm and improved EE/INV EE handling
Added global debugging level preference
Fixed debug levels