Add selenium tests with initial frontend testcase

Add support for writing tests with a real browser using selenium-webdriver.

Also, refactor startup and shutdown sequences to deduplicate them across different test files.

To run tests after this change, you must download ``selenium-server-standalone.jar`` from https://code.google.com/p/selenium/downloads/list, and set its path in conf.json as ``"TESTING_SELENIUM_PATH"``.  Once done, ``npm test`` will invoke Firefox for test cases.  See the Testing section in ``INSTALLATION.md`` for details on running tests with and without an X server, and with and without selenium.