Fix Issue 12027 - Iterate set bits in BitArray.

Also adds:
- countTrailingZeros(v)
- countBitsSet(v)
- bitsSet(v)

Notes:
- There is a `popcnt` function in `core.bitops`, but it only works with `int`.
- `bitsSet(v)` could be a bidirectional and possibly even random access range, but I'll leave that for future work for now.

https://d.puremagic.com/issues/show_bug.cgi?id=12027