Updated to run in a browser. Added test files.