Move Quartz Display utility functions into shared library (cg_utils.c).