Added metric_id support.  Extended unit tests.