Added functions to convert DataStructures to Entities, and vice versa