Make ghcjs build.

I've cherry-picked a couple of patches from the ghcjs branch and made some changes to the ghcjs derivation script.  The ghcjs derivation now builds, but it cannot be run without adding ${ghcjs}/lib/ghc-7.8.2/ghcjs-0.1.0 to the LD_LIBRARY_PATH.