Master osx test

Fixes to libagg. The main fix is in the last commit. Other commits are diagnostic and may be optional.