Clean up typedefs within the libraries

Make the use of typedefs more consistent between the different sub libraries, remove a possible portability hazard in using the 'long' type where a fixed-length data type actually was intended (and such a type actually was used in the main decoder/encoder libraries).