Merge some matrix utils and stuff from the NEON branch