General JS cleanup and comments