add digits! function

Added a digits! function, with an optimization for the arguably common case of base = 2.
As currently written, the code appears to always fill the array.