Added testing configuration for tox
Replaced list() calls introduced in 156669b79f2ae2208a662de06cbcdf1c349154c0 by one list() call.

Modified test case to use "assertIn" as the test also checked for order but the code did not enforce that historically.
Updated code to use the appropriate type for bytes in Python 2.x and 3.x
Generate unique job identifier using codecs module as bytes object has no encode() in 3.x.
Ensure communication takes place using bytes objects