Add ordering to categories and metrics. Fixes #13