updating build script to work without sed -r

This caused me an issue on OSX. Thought it might be useful for others as well. Also added some extra gitignores for Intellij developers.