Support promises during FB bootstrap and add missing $apply calls.