Refactor GitHub-related code a bit; add "restore hooks configuration" button