Detect chain reorgs that happen during a rescan.

While here, switch rescan method to use hashes, not heights, to refer
to starting and ending blocks.

Closes #151.

ok @davecgh