Port Region and Edge classes from JS; use shared_ptr for Circline API