added possibility to set timeout

Refs #25. No BC breaks. Tests pass.