Add millisecond timemout parameter to API 2i endpoints

Accepts non_neg_integer milliseconds (zero for inifinty)
Add support for an app.config setting for 2i timeouts