Theory of dynamic crack branching in brittle materials