Rewrote matrix allocation to facilitate clean memory management.  Valgrind now runs clean after 1000 iterations in a loop.

Replaced the custom PRNG in the original code with Mersenne MT19337, since nobody ought to be writing their own PRNG's
anymore (but was understandable when Slatkin wrote this).

Ready for SWIG and Python & R modules!