Add default license boilerplate, refactor common powershell code, fixes for raw/script modules.