Add kern and class method

Implemented like CRuby Random class.