As Saint Bartholomew the Great celebrates nine centuries, a new volume explores how the church has, against the odds, remained at London’s heart