Major refactoring/formatting. Fixed issue with WebDriver cookies.