Added max_sensitivity at the region and global levels which puts a cap on…
Added max_sensitivity at the region and global levels which puts a cap on detections that can trigger and event. Added detection threshold that requires a minimum number of detections before triggering an event. Added threshold on a per-region basis. Simplied some of the logic using js tricks.