Fixed parameters resolution of generated factories

The previous [commit](https://github.com/nette/di/commit/a1f48d002b9a67d2c23051576a2a62dc67e109cf) doesn't seem to work as expected in all cases (http://forum.nette.org/cs/20601-generovane-tovarnicky-s-parametry), most probably because it was rebased several times. Of course I will add more tests for this.



By the way the ` && $def->class` can be removed ant tests will still pass.