Simplify querying for timeouts, and introduce cleaning-up abilities to guarantee we don't skip any timeouts.
Added tests