New C++ Material density functions.

The implements #101