Use gnu sed's '-i' flag style. FreeBSD/OSX's sed usage is different.

Since we generally build release on Linux platforms (for jenkins, etc),
let's move back to gnu sed.
- More cleanup in prepare
- copy all packages/etc into the right place
Bam, beta 1
Build flatjar as well