spacing and trailing lines
fix non-existing variable name
use native min and max functions
index-of function doesn't exist
add moz prefixing for non dppx queries