Generalised ballooning theory of two-dimensional tokamak modes. (15th December 2017)