Bug 1074765 - Test PeriodicWave output. a=abillings
Bug 1074765 - Move const periodicWaveSize multiplier out of loop. r=rillian, a=abillings
Bug 1074765 - Increment phase after sampling to begin PeriodicWave at phase = 0. r=rillian, a=abillings

This makes phase consistent with the sine OscillatorType and with Blink's
custom OscillatorType.
Bug 1074765 - Use greater weight for nearer sample in PeriodicWave interpolation. r=rillian, a=abillings
Bug 1012609 - Improve PeriodicWave phase-wrapping logic. r=rillian, a=abillings

This approach takes advantage of the fact that periodicWaveSize is a power of
2 and uses unsigned integer modulo arithmetic to find the appropriate phase
of the period.