Redo changes in #11, removed by #12

While working on #12, I accidentaly merged the branch configurable-timeout. So I reverted commit de4661e28d031e4de6361e5ab474112df984eb5e, and this removed the configurable timeouts code from master!
Merge pull request #16 from rborer/configurable-timeouts

Redo changes in #11, removed by #12