Moving the Mage::app call before the profiler call

Moving the Mage::app call before the profiler call, per discussion with
David Alger