First commit

A lot to fix, and a hell of code clean job to do. But for now this is
working.