added preloading of entities, and fixed setting an entity's position on load