Added the begginnings of a `driver' module.

Eventually this module will be responsible for running the main
loop, segregating it into logical subtasks and allowing the
programmer to provide callbacks for each phase (maybe).
Added `driver' module to the build system.

Fixed some stupid bugs that never showed up because I didn't try to
build it x_X.
Changed leaky malloc to per-frame memory.