Do some refactoring in preparation for jack_engine becoming a c++ struct.