Flushing new collections

this includes and fixes https://github.com/doctrine/phpcr-odm/pull/477, https://github.com/doctrine/phpcr-odm/pull/480 and https://github.com/doctrine/phpcr-odm/pull/483

there might still be room to simplify code here but some of the simplifications I have already done have this feeling like they could cause issues in edge cases.
Duplicate logic from line 1115 no?