Introduces env var for number of threads to use.
Requires the other api's.
Adds typecasting.
IMPORTANT ConncetionAdapter management in config.ru
Fixes multithreading in #segtok.

No clue what's wrong with ActiveRecord here. Has to do with sinatra one
way or the other, as I can proof that the former behaviour works
elsewhere.
Fixes thread count.