Update ScalaDoc code examples not to use deprecated constructs

- Replace newTermName in favour of TermName
- Replace newTypeName in favour of TypeName

Review by @heathermiller