bugfixes: ensure advancing the offset when decoding an utf8 string

and take the offset into account when checking for buffer overruns before decoding short-binary data
first working encoder implementation

renamed srl_decode to srl_test ... since it's indeed just a test program
(which now tests both decoding and encoding)
support a compression threshold

(just like the perl encoder does)