Major speed improvements, added unit tests, and more

a.k.a. I forgot to do regular checkins while refactoring large portions of
the library, and now splitting up the changes would take far too much
time...  Oops.

On the plus side, we have tests.  And we're actually *significantly*
faster than dRuby.