Initial code to move the LEVEL_BASED priority/multifactor code to a
different file.
Fix it so priority_debug is only 1 flag throughout the plugin
Tidy up the new header files
Remove duplicate definition
Minor declaration mods
Move functions around so all static functions are together, on top.
Minor reformatting of extern definitions.