Bug 995289 - Use fmod to wrap custom waveform phase. r=padenot, a=1.3+