Probabilities and Potential B: Theory of Martingales