moved rule set handling to module, improved console logging, squished a few bugs