REF/TST/DOC: Refactor take num array bits, add tests, clean up some docstrings