Upgrading to work with the Moodle 2.4 API.
Upgrading to match the Moodle coding guidelines