Cleaned up code for generating definitions.

An extra Rake task for generating definitions for the current Ruby runtime was
also added.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>