I'm not sure how easy this would be, but if it's at all possible, I'd be very interested in an extension of this that allows for arbitrary bases--this would have been very useful when working with digital nets, which involve a lot of operations on small numbers in prime bases.