Use NS_NOTREACHED instead of a generic assertion.

Suggestion from ehsan.
Fix a bug where the type was never set to custom.

We'd send the custom waveform data, then call SetType, which
rejects setting the type to custom, assuming it came from
web content.

Instead duplicate the SendTypeToStream call in setPeriodicWave.
We now send the index length before the custom data so we can
do more checks on the recieve side.
Restore pre-defined waveform generators.

They might be useful later and it reduces the diff from chrome.
Sort of. There are porting changes to most lines.
Fix up nyquist trimming.

Chrome's FFTFrame 'packs' the nyquist component into the imaginary
part of the DC coefficient. This is why halfSize is N/2 in their
code. Our FFTBlock uses the kiss_fftr convention where there are
N/2 + 1 complex coefficients but the imaginary components of the
DC and (N/2+1)th coefficients is ignored.

Thus we need to trim nyquist at the end, not the beginning.
WIP. add a pointer to blink's PeriodicWave stucture.

We can initialize this in SetBuffer and use it to generate the
output in ComputeCustom.