Convert wave-sorted vis into library object

Convert the wave-sorted visualization from an effectively-standalone
procedural routine into a library object which can be used to generate
sorted wave visualizations from various input sources and for various
output encodings.