Use phpunit as a library.

This also updates some other build-related files and helps standardize things.