Fixed compilation under OS X.
Refactored the converter code.
Refactored and fixed LOD code.
Fixed bad ordering of surfaces in different LODs.
Fixed rotation of normals into world space.