Most important things are:
1) OnLoad gets called multiple times - remove the callbacktype "load" from lib.Processor
2) Remove stray SetDefault at line 243
3) Use the locals from line 39, i.e. default, get. Consider adding more locals (e.g. GetFaction)
Additionally there is some confusing naming throughout - changing a few local names may make the code easier to understand.