matchMedia polyfill for testing media queries in JS