Refactoring

Cleaned up the kangaroo class, and moved some low-level functions for
the kangaroo into a C library.