fixed addition of term counts to terms
support facet  term queries
don't use var with same name as the func it appears in...
support both str and int for facet term IDs

This is important for topic and facility
separate function for extracting facet term ID from text

This is necessary for cases where term is something like
"Publications [74]" or "Manzanar [7]".
detail pages now make correct URLs for integer facet terms

Existing records store topic and facility as strings with the
IDs in square brackets.