Added automated testing.

In the `tests/` directory, you can open runtests.html to run the tests
for mmd.js. These tests are defined in tests.js.