This is only to keep the D7 and D8 as much as possible in sync (for now!). Since there is no more /profile folder in D8, we need to get the profile path with drupal_get_path(). That is perfectly valid in D7 as well, and probably best practice anyway.
I couldn't resist to sneak 2 minor clean-ups in:
- There was a missing hyphen in the .info description
- I remove the $directory === 'libraries' variable, since it cannot be altered anyway, and I don't think we will be changing that anytime soon (and it wouldn't be that big of a patch anyway...).
In case this comes back green I will commit this pretty quick, so I can move on with the D8 port.