Add IDEA files.

Update copyrights, fix jslint issues, tidy code.