Factor out preloading-related code.

We will need to be able to disable that for Qt 5.4 when using its new
internal hooks.
Don't make hook installation specific to function overwriting.

We'll also add support for Qt 5.4 hooks there eventually.
Move the Windows entry point to its own file.
Move the Mac entry point into its own file.

We are also going to need this for the Qt 5.4 hooks.
Add support for Qt 5.4 hooks.

This should solve problems with function overwriting being unreliable in
release builds, and it'll also allow precise object tracking on runtime
attaching.
Compile on Windows/Mac.