Straight copy of hook_github() to hook_bitbucket().
Bitbucket uses repository->owner, not ->owner->name.
Add git_service_hook() for handling generic Git hooks.

Mostly (slightly) reworked code from github/bitbucket_hook().
Use git_service_hook() for Bitbucket.
Use git_service_hook() for GitHub.
Clean up coding style.
Use Bitbucket payload's branch information.

Apparently the documentation for writing brokers[1] is
wrong/outdated, and the documentation for managing the POST Service
broker is more up to date. So updated the code accordingly.

[1] https://confluence.atlassian.com/display/BITBUCKET/Writing+Brokers+for+Bitbucket
[2] https://confluence.atlassian.com/display/BITBUCKET/POST+Service+Management
Move the KeyError catching from _hook_helpers to git_service_hook().

Less code duplication and the _hook_helper functions returning an
HttpResponseBadRequest() is not handled by git_service_hook()
either way.
Pass arguments from url() to git_service_hook() via a dict.

https://github.com/nijel/weblate/pull/208#discussion-diff-3009481
Merge pull request #208 from Freso/bitbucket_hook

Bitbucket hook