std.bitmanip BitArray refactor

I reviewed BitArray and found a few issues:
- constness
- incorrect treatment of "pad" bits
- many places where size_t should have been used.

Incidental fixes:
- https://issues.dlang.org/show_bug.cgi?id=11015
Why is this change necessary? Other methods that need to use the formula can simply access `dim` instead of `len`. I don't see the point of this refactoring (it also degrades performance in non-optimized builds due to the additional layer of function calls).