Lazily load profiler hooks

This gives a small (~3%) gain on rendering without profiling enabled, and cleans up the invocation graph a bit.
One problem with this is that it makes testing the profiler hard. I agree that we can break backwards compatibility here though, we don't actually use it ourselves anyway.