Minor CHAT_FRAME messages adjustement.

Moved the printing functions at the top.
"debug_on" is now "lpm_debug". Better use less "generic" names.
Minor code cleanup.