Rework event handler registration to be more robust.
Profiler now expects AbstractLog instead of Log.
Test Profiler.