Use six for py2 / py3 compatibility

Signed-off-by: Michal Čihař <michal@cihar.com>