Ported frontend tests to Selenium2 to support phantomjs for testing.
Tests refactored and reorganized.