Refactored code.

Avoided starting TermGenerator for each object being indexed.
Refactored xapian_backend.update.

Removed repeated code.