Refactor AbTest into separate classes and files.