Removed bug in MshLayerMapper::CreateLayers().

The bug occured in the case the mesh contains line elements.
Merge pull request #149 from TomFischer/MeshLayerMapperFix

Removed bug in MshLayerMapper::CreateLayers().
Added #include <algorithm> to MshLayerMapper.cpp to fix compile error.
move finalizeMatrixAssembly() into namespace MathLib
Merge pull request #151 from norihiro-w/move-finalizeMatrixAssembly-to-MathLib

move finalizeMatrixAssembly() into namespace MathLib