Changed linear solver to use expr_uses_vars function rather than a custom version of the same. Minor style tweaks as well.