This was already started rP19115, but this completes it. All ToJSVal/FromJSVal definitions are put in a separate header. I also clean up the AssignOrToJSVal duplication - there seems to have been no strong reason for it.
The functions were already static so this is rather straightforward.
Follows rP25366