leanify_r6 function

Move all methods of an R6 Class to an environment