New class and refactoring.

TEdge class added, GetBeginVertex for Edge function added, refactoring.