Added add-hook-if-exists, updated add-hooks-for-packages