Add tests for demos

We now have automated tests for the demos both before and after they are
moved to the dist directory. This change requires that phantomjs be
installed.

I also moved the old tests from test/ to test/unit to keep the phantomjs
and unit tests separate.

Fixes #79