Improvements to entity diffing code

More of this. Why? Nobody will ever be able to maintain these. Use the constants please.