Refactor the JavaScript for the project form

- Chaining where needed
- Moved all strings to templates