Add a to_js method to the casting trait code in CodegenRust.py
Replace the manual checks and calls to transmute_copy in /layout/wrapper.rs with calls to to_js

Fixes #3616
auto merge of #3655 : kaseyc/servo/add_to_js_method, r=jdm

Replace the manual checks and calls to transmute_copy in /layout/wrapper.rs with calls to to_js/

Fixes #3616