trimmed form fields for user and course forms

I have also fixed courses add/edit form. When an error occurs such
as an identical course name already exist, the list of instructors
do not get repopulated and there are invalid variable errors. I've
fixed this by modifying the form to generate the Instructor array
to be in the same format as Department.