Tools for tensor analysis and decomposition