simplify upload-editing interface a bit, do a little bit of input validation. Also do array splicing right to get the new segments in the right place