title: Move all threads older than X with gmail api
body: <p>I have a folder, <code>Archive</code> where I'd like to store all of my emails from before a given date. </p>
  
  <p>In the Gmail web UI, you can accomplish this by doing a search like "in:inbox before:2012/01/01", select all, then "move" from the dropdown.</p>
  
  <p>I'd like to do this with the gmail api. How can I accomplish this? Will I need to do the query then iterate through each thread to move it? Or is there a better way?</p>
  
  <p>Bonus points for a code snippet / example or link to the relevant section of api docs.</p>