add support for concurrent threads in python3 version

Signed-off-by: Mattias Andrée <maandree@operamail.com>
improve python3 version speed by never using static methods

Signed-off-by: Mattias Andrée <maandree@operamail.com>