The K-theory of hereditary categories