Add riemann.folds/count-unexpired

[Finishes #165]
Merge pull request #288 from DanielleSucher/fix-issue-165

Add riemann.folds/count-unexpired