Rearrange includes to improve compile times and allow for memory leak checking on MSVC.