CMS-3350 Use generic source classes in scripting code. Added readLines in resource class.