Cleaned up the modal_forms.js.

Made the function naming idiomatic js. Also fixed a typo.