Wait functions for state

I added waiting functions for state and merged `waitLock` to state.
I intentionally did `State.WaitLock` receive `timeout` always. Because if you want waiting something forever you must suffer and think twice about it.
Also may be makes sense to embed *State to container - this is for discuss.
Here you set the state to stop after you write to disk.

I guess it's an issue because the container will be saved with a running state, no ?