db.build_tokenmap(): in the least, should use pretty dict comprehension with enumerate.