fix over manipulation of strings

- the fix for bug 10994 caused Emacs to hang since modified string is
  not "eq" original.

- reverse order of list as api expects

resolves #6
resolves #2
resolves #4