Removed dependency on Ruby.

C implementation of various functionality.

bug fixes.