Removed the (now useless) embodied entity index
Fixed a couple of memory leaks due to factory data of loop functions and qt user functions still around after destroy.