Use smart pointers in driver.cc
Very messy fix for |m| conservation on T elements