More refactoring + deferred shading work and start of dll support