Moved a ton of stuff to compile better for different systems.