Fixed beam matrices, tests and examples

Cleaned up the tests and the examples for the 1D beam.  Doing so
highlighted some errors in the beam stiffness matrices for 1D and 3D
beams, which have now been fixed.