Ported frontend tests to Selenium2. This makes it possible to use phantomjs for testing.
Tests refactored and reorganized.