DIC Factories: automatic resolution of parameters

Reworked from nette/nette#1289.
Not sure about convention of multi-line conditions. Is this ok?