Clean up libc / libcxx build infrastructure.

This creates a couple of additional methods to reduce copy/paste
and make things a bit easier to follow.