Dynamic forms after pr8827 2.3

A rebase of #2927 onto 2.3. Also, this PR explains how to make one listener for the two situations, which was not possible in 2.2. See https://github.com/symfony/symfony/pull/8828

cc @bschussek