Switch from refclasses to R6
Update tests for R6