refactor fixPluginfile into moodle.utils.js