Wait for a numeric on IRC notifications

Code originally by Nick Markwell (@duckinator), ported to the current
codebase by me. This is a port of the code in travis-ci/travis-core#56.
Remove unnecessary line

If we refer to @numeric_received when it's not initialized, we'll get
nil back, and since we just need a falsey value, that's enough.
Error build immediately on parse error

This creates the build, job and a log with an error in it.
Add tests for parse error build erroring
Add Job#log_content=

This creates a log if one doesn't exist and sets the content of the log
to a given string.
Fetch users by GitHub ID instead of username

This will also update the username if the user was renamed on GitHub.
Update user's repositories when username changes
Fetch user from GitHub by ID when creating
Change loop to `update_all`
Move user data fetching to separate method
Only update the user if it exists
Update repositories owner instead of permissions

The old code would update every single repository the user has
permissions for.
Use branch instead of ref in Request::Approval

Pull Requests have refs on the form "refs/pulls/[pull-id]/merge", which
doesn't match the Regexp, which is the cause of #1056. This uses the
branch instead, and fixes #1056.
`notes_for` doesn't use format for now
Add tests for find_or_create_user service
Add unique index on github_id, remove unique index on login to users
Nullify logins for orgs and users if new github_id has the given login
Nullify logins for rogs and users on login change
Make repositories(github_id) index unique
sync more info for orgs