improve handling of non-primary indices, foo_id primary keys, 0000-00-00 dates

* preserve 'KEY' lines in CREATE TABLE as CREATE INDEX statements
* if the first row of the table is [...]_id, consider that a
  primary key
* replace '0000-00-00 00:00:00' in table default values and use
  a date in 1970 instead of 'null' on table inserts