Changed insertOrReplaceEntity and Improved Documentation in Places

insertOrReplaceEntity now properly passes the updated entity to its callback function. The code mimics updateEntity, which I imagine is that the intent was.

Additionally, I changed some function documentation that was incorrect / copy-pasted from other functions.