Refactor JS.
Add LICENSE.md.