Moved more state into $self and factored out methods for reading test file and setting some variables