Support for data-driven playback. Cleaned up some loading code. Issue #141