Add SCAN command

I'll write up the details for this technique later (wrote a nice and details commit message, but vim trashed it).