New method save() on repository

Fixes issue with lack of em->flush() call after new resource set
@norzechowicz Yes, but we use them in different situations.