Cleanup of metric and period classes. Working tests.