Fix sed to work on both Linux and OSX
Fix count-facts
Update regression test and user docs with count-facts