Pivot reporting framework

Yours is better. Ceri says hi btw.