Adding a code version mismatch detection feature. Fixes Issue #2710

Conflicts:
	resources/static/common/js/network.js
Hook up the code version check middleware.

* Use the X-BrowserID-Version header in all WSAPI requests to signal which version of the code is being used.
* Make sure all the /wsapi calls in the tests have X-BrowserID-Version headers
* Update version retreival to occur asynchronously.
Fix generate_code_version never calling the callback - writeFileSync was used instead of writeFile.
only update code_version.js if the saved version is different to the current version.

Every time code_version.js is updated unecessarily, all JS files are rebuilt for all locales, wasting time.
Only log code version mismatches instead of returning a 400 error.
Changing X-BrowserID-Version to BrowserID-Version as per RFC 6648

http://tools.ietf.org/html/rfc6648
Update version to deal with ephemeral instances.