Added documentation, fixed formatting and improved if conditions
Added documentation, fixed formatting and improved if conditions

r14519

krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate,krosenvold/selenium-git-release-candidate