Fix Python3 errors in test_suite

In Python3, there seems to be a difference in being able to refer
to class attributes before initialization. To circumvent this,
all initialization code that refers to class attributes is in
__init__()