Optimize rules generator
Add demo page
Fix spelling