Make demo proactively send files to server
Remove some duplicate code in the demo
Run Tern server in demo in a web worker