CMS-3925 Refactor module resource classes for use in scripts.