Refactored tooltip routines out of chart.c and into misc.c

This simple refactor pulls some of the tooltip-specific code out of chart.c such that other controls that might use portions of the tooltip code can do so without replication.  The refactor has been tested with the chart example, and it seems to work fine.

This pull request does not add any features.