Revert "Converted entity stuff to shared_ptr."

This reverts commit 8f0ced7d66eaf2ac92878b4ec6ba19fc4284bca4.