Modified to use couchdbkit.