Option to write queries to external file

Added an option to write the media queries to an external file.