Add generateBatch method to db API.

Fix #61.
Merge pull request #62 from phuu/gen-batch-pairs

Add generateBatch method to db API.