style and documentation changes to conform to moodle coding style guide