Replace itervalues() with values() for python 3.
Add tests for shutdown method.