Added condition codes to the encoding functions. Encoder ok for now,
should be enough to write out to the code cahce. Started work on the decoder.
Removed the HAVE_TLS define to avoid TLS memory issues.