Fix up some compilation issues
Convert wave to use an object oriented operation container
Initial implementation of cortex, untested