Cleanups, including platform.h in cf-upgrade, and linking it to libcompat.

I think this needs quotes around the ``$ULN[]_PATH``. If it's empty the whole expression will fail because the evaluator will see ``test -z && ...``.