added MetricGraph, moved stuff from core.py to convex_core.py