XCOMMONS-442: Upgrade to Selenium 2.40
* Fix failing functional tests.