Added some unit tests, changed interface of Edge classes for simpler
codes.