Remove unused variable from struct WhereInfo. Add some explanatory comments to new code.
Add further tests. Fixes so that compilation without ENABLE_STMT_SCANSTATUS works.