merge util/algo.h with cons.h; add generic refcount type; separate value
type and tag