Make simple LDC program compile

As discussed in issue #840, compiling the output of LDC with emscripten failed for me in various places. Here are some solutions which made [a simple D program](http://martin.von-gagern.net/bugs/2013-02-09-LDC.ll) compile.

I still don't see any evidence of my application code in the result, weven with `-s EXPORTED_FUNCTIONS="['_Dmain']"`, but getting it to compile sounds like a step worth sharing.

Make sure that my modifications actually go in the right direction. For some I'm far from certain.