Added some more tests.

Mainly for lib/connection and lib/mqtt