Fixes issue with metrics tab click handlers
  Click handlers were not getting attached to DOM elements in some cases on slow running machines.
  Added logic to attach handlers when elements are ready and also made sure handlers
  are attached only once.