Added linearity tests to linear solver

I've added a visitor to the linear solver that classifies an expression as constant, linear, or non-linear in a set of free variables. There are cases where I'd like to be able to identify linear expression before I apply the full linear solver, and this addresses that issue.