Added support for building dependencies. Added script for building entire stage