got rid of total_heap_size metric because it is no longer supported by webkit

Also rewrote a bunch of the webkitclient methods using a helper to make it more concise.

Test plan: ran the googlesearch and sample flows and verified success and plausible results.