Dont switch or restore blog unless we are in multisite AND cross site search is enabled
Tidy up PHP
Pull out utility functions; test for basic single site search