Add class and method documentation related to type casting.

Move previous documentaion from .rb files to .c.