Moving the waveGen functions into their own files

Still a lot to do here, but the functions should now be at least
one-step removed from the main project.