fix small typos (False -> false)
local-ize a couple of variables
rules_all has to be global.  made it so, confined to pipeworks.{} table