jasmine! and Entity sorting by depth

and a few tests