Raise max Hash to 1TB
And use size_t where appropriate, as suggested on FishCooking.

No functional change.
Use compiler intrinsic instead of assembly for popcnt
No functional change.
Revert "Use compiler intrinsic instead of assembly for popcnt"

This reverts commit a69f1d7c2060dc7b320a7b4801105df00b22a96a.
Merge with master