Added a promise and simple syntax version of insertOrReplaceEntity and insertOrMergeEntity.