refactor QueryFactoryResult for caching

This commit adds result caching to the QueryFactory.

The QueryFatoryResult has been split into two classes.
One works with Doctrine\Common\Cache\Cache interfaces. It reads
the entire result set so it can be cached by DBAL.

The original implementation is mostly unchanged from before.
Set the ArrayCache for QueryFactory in storefront.

This kind of caching is already implemented in a standard zc 1.5
install, but we can use a decent interface :)