Updated to master, VS2012 fixed, conflict resolved.

I can't understand a lot of the maths but the code appears sound, it compiles and runs so I'm ok with seeing this merged now.