DIC Factories: automatic resolution of parameters

Reworked from nette/nette#1289.
Now that you mention it the first part seems to be redundant.