add low level implementations of xlines, rays

refactor entity and entity data classes accordingly