refactors mqtt tests and client factory

* introducing `once` to ensure that the callback only gets fired once
* refactors tests to be more DRY
0.15.2