Add library code that implements the maketx command.

Pull out the heavy lifting code from maketx.cpp and create a single function call that accepts an ImageBuf, ImageOutput and parameter structure to generate an output texture file with mipmapping and tiling. All options are identical to the maketx command line.

Slight modification to ImageBuf::read() to NOP on user-allocated buffers.