Make struct passing work properly

this is ~~a first cut at~~ rebasing #3466 onto master. @Keno let me know if you see anything that looks wrong.

 - [ ] I have not tested it on windows yet. (only linux 32/64 and mac 64)

To keep track of issues (from comments) from the previous PR:

 - [x] Need to add link to LDC
 - [x] ~~Need to figure out what to do with fixed-size arrays.~~

https://github.com/JuliaLang/julia/blob/31eb8d432bc69f617091fbc0406d3aab442360e9/src/julia.h#L542

seems to indicate this change was correct?