Refactor namespaces to core.matrix