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

* Hook up the code version check middleware.
* Use the 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 BrowserID-Version headers
* Update version retreival to occur asynchronously.
Update generate_code_version with @ozten's suggestions.

* Move generate_code_version.js into lib.
* Simplify generate_code_version.js's logic.
* Bubble error messages up to invoking functions.
* Use generate_code_version.js when fetching '/build/code_version.js'
* Only server '/build/code_version.js' in non-production environments.
Merge pull request #2934 from shane-tomlinson/issue_2710_wsapi_ver_lock

Issue 2710 wsapi ver lock