Updated build and install scripts.

Added `common` script for use by both `build` and `install` scripts.