Clean up the oscilloscope visualizer code

I'd love a code review from @paez.

I didn't fully understand the old code, so I refactored until I did. I think it ended up being more readable and I may have even removed a few off-by-one errors. Also, the amplitude does not always start at 0, which I think was incorrect.

This should lay a good foundation for implementing drawing real pixels in the correct colors (#71).

Criticism welcome.