Finished the inference code and made some fixes.

The fixes suggest the model derivations are wrong, I need to
double-check this.
Added a test runner using known parameters to generate inputs

We check if we get the same known parameters back