Latest work

It is still pretty ugly, but at least with an integration test it seems to be doing its part.
I just decided it was not critical for the time being.