use caching/multithreading treesearch objects in web interface

- map sentence IDs of dact corpora to integers so that matching
  sentences in other treebank formats can be found; a bit of a hack
  because it's slow, but otherwise arbitrary sentence IDs couldn't be
  accepted.
- return sentences as a single string of space-separated tokens
- optionally return indices instead of counts
- etc.