Fixed a bug in the Export to CSV plugin.

Also the addEntry method has been refactored to use functions from the
plugin_utils.py module.