Added 2d line and ray. Code cleanup.