feat(src/util): add interval class, use in scoped_env