Linear Algebra infra

Linear Algebra infrastructure for choosing the backend. towards #1973