BUG: fix safe_update to conserve file permissions.
FEAT: add detection functions to machotools.