Refactored a few methods out of math3d.func. Removed copyright notice from files from third parties.