Scripts with some fixes from: http://googlewebmastercentral.blogspot.co.uk/2011/12/download-search-queries-data-using.html