Fixed duplication of children in parent's collection during flushing. #379

Fixed duplication of children in parent's collection during flushing. #379

Fix indentation issues
Merge pull request #390 from sarcher/issue-379-tests

Resolve duplication issue when adding children to a parent's collection #379
Allow retrieval of non-flushed document translations.

- getLocalesFor now takes into account pending translations
- Prevent binding a translation if it would overwrite an existing translation