Fixes to the SuperMemo Importer

Hi Damien,

I encountered some problems with the SM XML importer; these commits should fix them (see commit messages for more details). I also did some clean-up by removing an unused, hefty function.

All these changes are licensed as public domain.

Cheers,
Jussi Määttä