Split trig and several basic functions into header files.