move DB class to library, rewrite db queries for Models RunUnit and Branch
format sql queries for models Email and Email account, add method for mysql duplicate update
use singleton for DB object
Code formatting for Item Model, abstract queries in External Model
more code formatting and query abstraction for models
abstract SQL queries for survey models
cron fixes
sql formatting for Survey and Run models, create template for runs
use DB abstraction in RunSession model