Applied Matrix.patch from Saltyhorse with some changes. Added NUnit tests.
Applied Matrix.patch from Saltyhorse with some changes.
Added NUnit tests.

google-code-export/monoxna,aizhizhu/monoxna,aizhizhu/monoxna,djkhz/monoxna,google-code-export/monoxna,aizhizhu/monoxna,mjs513/monoxna,inizan-yannick/monoxna,inizan-yannick/monoxna,mjs513/monoxna,inizan-yannick/monoxna,mjs513/monoxna,inizan-yannick/monoxna,trojankai/monoxna,google-code-export/monoxna,google-code-export/monoxna,mjs513/monoxna,trojankai/monoxna,google-code-export/monoxna,mjs513/monoxna,aizhizhu/monoxna,trojankai/monoxna,djkhz/monoxna,djkhz/monoxna,inizan-yannick/monoxna,trojankai/monoxna,djkhz/monoxna