Revert "Converted entity stuff to shared_ptr."

This reverts commit fc94b53357691d86d09876b8a2819be615b7b8ff.