make count_store_genv polymorphic

so it can be reused in IL4