Separate JS for annotation editor into its own file