Some internal changes; introduction of automatic loading of relations; scenario variable