Calculating the Closed String Hamiltonian (T-Duality)

Working with the bosonic string in a background space-time with one compact dimension, i.e.: $$R^{1,24}\times S^1$$ I have been able to calculate the mass-squared: $$M^2 = \frac{n^2}{R^2} + \frac{m^2R^2}{\alpha^{'2}} + \frac{2}{\alpha'}\left( N + \bar{N} - 2\right)$$ Here n and m are integers related to the quantisation of the string momentum and winding respectively.

I would now like to calculate the Hamiltonian of the closed string in question. My first thought was to sum this with the momentum-squared but I can't seem to get it in the proper form.

I also thought that perhaps I could start from the Lagrangian density in the Polyakov action: $$S = \frac{-1}{4\pi\alpha^{'}}\int d\tau d\sigma \sqrt{-h}~h^{\alpha\beta}\partial_\alpha X^\mu\partial_\beta X^\nu\eta_{\mu\nu}$$

Could someone please give me a nudge in the correct direction, I feel like I'm overcomplicating this.

Thanks,
String Theory Newbie

Edit:
I've figured it out now, I'll type my workings up as an answer tomorrow morning. Hopefully they will aid any weary travellers that reach this final bastion of hope.