updated readme, added comments, bugfix in example.

also some code refactoring. The bug in the example was reversing an
array containing unicode data. Sometimes characters spanned 2 bytes and
so reversing these bytes messed up the string.