Refactoring.

lagrange_polynomial_degree is now actually correct.
Fixing a bug with the model viewer.

Now does not omit border elements.