Adding discrete debug functions
New debug function finished
Unused macros removed
Adding debug precompilation
Converting unit_functions to new debug