Moodle XML import and export.

Also, fix broken unit tests, and codecheker issues.