Add riemann.folds/count-unexpired

[Finishes #165]