Add a new cast method to remove casting logic from klass constructor.
Update klass API to accept a klass as an arugment, and both static and prototype methods will be casted. If any non-function argument is passed, only the prototype methods will be casted.