Update malloc(2) to xmalloc(3)
Change encoding to use default external
Change to more robust signal handling