Separating into multiple files. Adding some basic documentation. Moving some math functions to MathExt