cleanup in preparation for and preparation for use of pylibgamma

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

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