allow indexing on URI

If we restrict URI pieces to those with balanced brackets, this will
prevent a lot of useless URI indexes -- in fact, only complete assertion
URIs will get indexed, which is fine.
update extract_wiktionary to use transactions