Altered the code so that the plugin was compatible with the changes in Moodle's calendar type system

Also made some slight changes to PHPDocs etc.