Improve webservice caching etc.

This fix provides webcache options inc. option to use stale data for
performance, and improves prioritisation of various types of webservice
call. It is a bit hefty, and undoubtedly scope for code improvement.