Branching Brownian motion and its applications