Add support for emscripten as a compilation target

This allows tidy to be compiled as a .js file, and run in a browser