now restarting the task, when it dies, in a cleaner way: with restartItself()
1. Now passing a closure connectToSql. 2. Added a method seriesId that SELECTS the appropriate series id by type and name and, if none is found, INSERTS it
In the autogenerated table series the field 'type' is now NOT NULL so that the pair (type, name) would be truly unique. In MySQL (and afaik some other rdbms such as PostgreSQL) null fields do not break non-uniqueness
Now also passing a closure to connect to sql to the Backend Task. Note that it is script.&connectToSql --- converting a method to a closure