Add timeout handling.
Remove c++11 dependency.