Multi-step script support.

I'm using this patch for jlabusch/shotter, which needs to be able to log in and navigate around a site before taking a screenshot.
It obsoletes the other two pull requests I have open, but I don't know if it's something you're interested in.