Check in support for automated javascript unit test cases

The tests need to be run in the emulator if they use plugins, otherwise, they can be run in automated fashion by using a headless web browser.