Copy of the basic tokyocabinet gem (1.29 by peleteiro) with a small fix for ruby 1.9