clean up code, javascript-only, change license