Consolidate bitCount and popcount

This removes code that appeared to be duplicate.
Merge pull request #13 from statik/remove_duplicated_code

Consolidate bitCount and popcount
Minor cleaning with respect to popcount.