Support nested media queries. Closes #931