Who invented the metric system and why?