Datetime fixed.  Container class queries use %(varname)s instead of :varname.  to_database reinstated in many (but not all) places