Add output caching to pooling along with test modifications