Extract repeated regexp to a method
Don't replace prefix when it would be a no-op
Ensure cellar path is replace correctly for relocatable bottles
Revert "Disable bottles when HOMEBREW_CELLAR.parent != HOMEBREW_PREFIX"

This reverts commit fdf20dc43971b728520d518f3b6ef0bcb16aeb21.