Merge pull request #2 from bendiy/xtuple

entity_operations: Switch to old branch of dev code that works with xTuple.
Wrap foreach in check for .