Attempt at caching for group portfolios

Though it's still broken to some extent

See #935