OS X compatibility: Darwin sed -i requires an argument
OS X compatibility: BSD sed can't handle \n newlines in sed patterns

Used a solution described at:

http://stackoverflow.com/questions/723157/how-to-insert-a-newline-in-front-of-a-pattern
OS X compatibility: use different config file for Darwin builds