Added unit tests for EpiSurveyor connection check. Also fixed a bug found because of tests. Should have checked for key. Not for error.