Pull shared build logic up to root build file and share across non-demo submodules