Add a bunch of unit tests. Quote a few of them fail at present.
Add simple test case for the double-expand bug.
Fix tests: not all bytes are valid in all off the iso-8859-* encodings
Fix type mismatch in test generator.
Fix for the double-expand bug (op is calculated wrongly the second time)
Remove duplicate calculation by introducing 'newolen'.
Calculate oleft without recurrence.
Remove NUL-termination stuff. Neither iconv nor Erlang cares about it.

- There is no special reason for the driver to do NUL termination.
- In fact, it may surprise that it doesn't return characters after the first NUL.
- Furthermore, this change does away with the strlen() call.
Remove debug output from test code.
Fail instead of doing the wrong thing on large inputs.

Silently ignoring the last N*65536 bytes of the input is not a good idea...
Handle input binaries up to 2^32 bytes, rather than 2^16 bytes.
Fix the memory leak.
Merge pull request #2 from trifork/master

Fix a number of bugs, and add unit tests