Added a couple of template validation procedures ("added a couple of templating system datatypes") to bring the kernel and templating system's view of datatypes closer together. Added to_sql/from_sql helpers to move that functionality from ad_form into the templating system.