Turn the bulk of applypatch into a static library so it can be used from the updater. Also build it as a standalone executable for use by the existing OTA mechanism.