DIC Factories: automatic resolution of parameters

Reworked from nette/nette#1289.
I'm not sure about convention of multi-line conditions. Is this ok?