Modify printInt and printUint to accept base.

This paves the way to improve how byte arrays are output as well as
increases the flexibily of the functions.