Modify base webapp code, class-ify datsasource, add Templates class