Refactor Circuit class and tests to match component changes.