Fixed codenarc issues and implemented getAsDomain() in PWDService