Factor JS out into a separate file.
Add form validation and asynchronous submit.