Finished smart scan(1) AI that wraps around grid. Fixes #30.