[iOS] Factor some model logic out of switchToTabWithParams:

This CL factors some model-layer logic out of BVC.

- The logic for finding a webstate with a given URL is moved, as suggested, into WebStateList, along with unit tests.

- The logic for identifying the "NTP with no history" state is moved into ntp_util.

Some other cleanup is done in switchToTabWithParams: to reduce the use of local variables and make the code more separable.

Bug: 893121
Change-Id: I6f8def5380df31f8babeb0355102c6efb38c9a69
Reviewed-on: https://chromium-review.googlesource.com/c/1386830
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618542}
7 files changed