Refactor memory measurement

Move out all the memory measurement to a separate class that can cache
all of its data through orientation changes.

Tweak the display to make it draw large squares for the legend instead
of a 1x1 square. Add padding to the percentage bar chart.

Change-Id: I4cd5bc4ba31a422a55740e8f58e5e571cf9866a5
6 files changed