Add global on/off toggle
Add handling of the global rule

add test case for global rule