Refactor some of source edit form JS into its own file and object