make sure wfWikiID() is available
refactored the code a bit and introduced profiler sinks