integration cli: add some utility functions and use them

This PR adds functions required to run commands with timeouts and convenience functions for running Docker commands with timeouts.

It also adds a getContainerState function to make it easier to get a container's state (running, not running and its exit code if it's not running).
I'm with @LK4D4 on this one. It's a pain that we can't see the right file and line number