Remove unused _ssm variable
Optimize loop condition statements by storing array length
Remove unnecessary semicolons
Add necessary semicolons

Before this starts a flame war on the use of semicolons, I'm only
following the style of the author's initial syntax.
Add debounce logic to resize event

The resize event fires at an extremely high rate. This will keep
things a little more sane and improve overall performance by not
having to loop through every state and perform (potentially)
performance-intensive callback logic hundreds of times each second.