Converted tests to class to avoid icky globals