Remove unused import.
Change FIXME to TODO.
Introduce option for input encoding.
Use input encoding option.
Fix input encoding parsing.
Ignore test data.
Add debug output on excpetions and improve error messages.