Add first draft of probability distribution calculation.

Query parsing is still missing, so this is still useless.