DIC Factories: automatic resolution of parameters

Reworked from nette/nette#1289.
This could be moved somewhere before foreach as it is tested by isset later anyway.