Update build script.
Redesign and fixes.