Ported bootstrapping code from angular-embryo