Allow register to be used as a class decorator (#322)