database: added QueryWithVisibility, and Query hide dead-end forks by default