add tests and change supervisor to be a class