Added lots of comments, and fixed indenting.
Added PAPI support. When PAPI is enabled, all timers also collect
PAPI_TOT_INS, PAPI_TOT_CYC and PAPI_L2_TCM. Nothing is done with them
currently. At the end of execution, all PAPI counters are summed over
all worker threads, and they are output if APEX_SCREEN_OUTPUT is set
to 1.
apex_stop should be apex_stop_profiler.