Eign math

Changes to use Eigen instead of homegrown linear algebra functions.