flush the jobs on statechange as well as teardown
Update whitespace and comments
Merge pull request #4 from ftlabs/flush

Flush the jobs on media query statechange as well as teardown