Final fix for emplace

This should be the final fix for emplace.

It fixes support for static arrays, as well as for structs with const members. It also consolidates the code somewhat, and has even more unittests.

This should fix the new issues 11173 and 11178
http://d.puremagic.com/issues/show_bug.cgi?id=10973
http://d.puremagic.com/issues/show_bug.cgi?id=10978