setTimeout, resetTimeout, cancelTimeout methods

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
make sure I don't touch the timer when I get the "ready" string from melted

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
refactor out common cleanup functionality

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
don't mix .on and .addListener, complicates searching the code

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
better logging

Signed-off-by: Tomas Neme <lacrymology@gmail.com>
don't disconnect if already disconnected

Signed-off-by: Tomas Neme <lacrymology@gmail.com>