API optimizations

* [IMRPOVEMENT] Do not include smarty globals, they are not needed on the API
* [IMPROVEMENT] Display correct runtimeinformation of entire script, not
  just the SQL queries
Fixed refresh interval functions and memory leaks

* [FIX] Memory leak fixed in Hashrate Graph
* [FIX] Potential memory leak in Gauges
* [FIX] Properly refresh data via setTimeout
 * Ensures Ajax calls are completed before re-calling them