Style fixes to TimestampRange helper

- New-style class declaration.
- Newline after summary in docstring.
- Rename `assert_inrange()` to `assert_in_range()`.
Convert TimestampRange into a context manager

Makes it simpler to use compared to explicitly calling `.finish()`.