Split BasicLib and MathLib into their own files