[WIP] Chi squared test

API and code structure.
Let's make this a ```case class```.