Matrix object prototype and cacheable inverse calculation