Upgrade selenium to 2.40.0. and adapt to API changes. Closes #43