fixing null pointers and adding polymorphicentitymaputil (logic from abstractDynamicDataSource) to help build drop downs in rule builder