Utilities for checking server and client connectivity and hiding/showing elements based on the results

This is based on @ruimalheiro's original code, with @bcipolli's and @jamalex's modifications. Former code reviews of a lot of this code are at:

https://github.com/ruimalheiro/ka-lite/pull/6
https://github.com/learningequality/ka-lite/pull/272