Added a --profiler option to all maintenance scripts.

* This dumps profiling information in list or trace format as specified.
* Also optimized wfProfile* function like the ProfileSection class, which
  also plays better with Profiler::setInstance().
* Fixed fatals due to wfDebug() calls in Profiler::instance() due to that
  function not yet being loaded. The calls were simply removed.
* Cleaned up file performance test script a bit.

Change-Id: I6b8cd8b30fefc1904eeeeacada7a30a46f62fe2a
(cherry picked from commit d2dcea586d7685aefed2d5bd81d42b0176031481)