Fix mac sed

Fixes build_model.sh on OSX

* Fixes OSX sed not recognising newline
* Fixes echo not recognizing '-n' when executed with sh