Fix exception
Huge refactor, seems working, tests need to be fixed
More refactoring and improvements
Some fixes and initial tests for proxy.
Update more tests for di branch