Pivot reporting framework

nice tests and easy to read.

hi ceri!