Tidy up getHostKey
Make sure test for server URL is correct
Add connection status
Add check task
Add connection status and check hostKey is used
Factored out common request code
Move test helper code to end of file
Add test for caching host key
Test for bad host keys