Rearrange includes to improve compile times.

This also allows for memory leak checking on MSVC by having include
surrounding Qt headers, which break if you have a macro define new
to be something which tracks line information.
That's what the LUA_CPP option in CMakeLists.txt is for and I just added the same option locally to src.pro when trying to use qmake with MSVC.