A Theory of Branched Immersions of Surfaces