implement edge

edge and constant edge as wrappers on ring
improve memory management

use shared ptr for ring data
implement ring merge (Ring::fuse)
update type names in edge