Fix for issue #4. Now does not update an entity unless it needs to, better support for automated logging & concurrency scenarios.