Only erase a flash sector once to avoid erasing data written non-sequentially.

Fixed #7 !!!
Style cleanup in a few spots.