Added authentication option to Gateway and Deploy scripts
Added backwards compatibility to PHP <= 5.4.0. Reference from http://stackoverflow.com/questions/3258634/php-how-to-send-http-response-code.
Merged in ryhanen/bitbucket-sync (pull request #1)

Added authentication option to Gateway and Deploy scripts
Added documentation notes about authentication