count_vector: Make sure to preserve factor level order. Fixes #223