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