Add functional tests with phantomjs