Fix in the Collection Element implementation

The current implementation of Collection Element imposes, in
prepareFieldset(), that the child element keys are set sequentially,
starting from 0. After that, populateValues() will remove the unused
indexes and add new ones, according to the input data. This behaviour
breaks the test in this commit, as it expects that the first key will
always be '0', which is not always true, as when collection elements
are dinamically added or removed with javascript. The changes done here
makes Collection Element more flexible and maybe a little faster, as it
saves resources by avoiding unnecessary creation of child elements,
adding them just when neccessary. Also, self::$lastChildIndex can be
sent along with the template, so javascript can set a proper index for
the next element to be added. FieldsetPrepareAwareInterface and all its
references were removed, as they are no longer necessary.
Add test from issue #5010
Ensures that collections with allow_remove don't re-create child elements if they all were removed
Revert "Ensures that collections with allow_remove don't re-create child elements if they all were removed"

This reverts commit 99d16a4f0684bd46e430420c2a29514bfb15fa01.
Ensures that collections with allow_remove don't re-create child elements if they all were removed
Update
Revert 99d16a4..6e4abc0

This rolls back to commit 99d16a4f0684bd46e430420c2a29514bfb15fa01.
Revert 43a65f7..779b234

This rolls back to commit 43a65f74bff26fd22dbea40f8fa471cfe12d03f1.
Fix in the Collection Element implementation

The current implementation of Collection Element imposes, in
prepareFieldset(), that the child element keys are set sequentially,
starting from 0. After that, populateValues() will remove the unused
indexes and add new ones, according to the input data. This behaviour
breaks the test in this commit, as it expects that the first key will
always be '0', which is not always true, as when collection elements
are dinamically added or removed with javascript. The changes done here
makes Collection Element more flexible and maybe a little faster, as it
saves resources by avoiding unnecessary creation of child elements,
adding them just when neccessary. Also, self::$lastChildIndex can be
sent along with the template, so javascript can set a proper index for
the next element to be added. FieldsetPrepareAwareInterface and all its
references were removed, as they are no longer necessary.
Add test from issue #5010
Ensures that collections with allow_remove don't re-create child elements if they all were removed
Revert "Ensures that collections with allow_remove don't re-create child elements if they all were removed"

This reverts commit 99d16a4f0684bd46e430420c2a29514bfb15fa01.
Ensures that collections with allow_remove don't re-create child elements if they all were removed
Update
Revert 99d16a4..6e4abc0

This rolls back to commit 99d16a4f0684bd46e430420c2a29514bfb15fa01.
Revert 43a65f7..779b234

This rolls back to commit 43a65f74bff26fd22dbea40f8fa471cfe12d03f1.
Merge branch 'form-collection-fix' of https://github.com/saltoledo/zf2 into form-collection-fix
Rebased update
Correction
Merge pull request #5636 from saltoledo/form-collection-fix

Fix for the implementation of Collection Element