Add auto-pulling middleware and tests.