Fixed user and cohort post counting problem and added tests

fixes #135