add ranges to pre-hooks
use flexible range checking
this will be useful later
remove indirection
use new attach api in tests
support ranges on post hooks
document new api
3.0.0