Move javascript to separate files, added comments.