Minor database change
- Text fields should be UTF-8. Fixes #491
Alter INSERT IGNORE queries to workaround innodb auto increment behaviour

An INSERT IGNORE query will still increment when using innodb, even if no row is inserted.  We can work around this by using a slightly convoluted query, but this only works if the table is non-empty, so also check for that on startup and create a dummy record if necessary.
Merge pull request #493 from frymaster/set-text-type

Minor database change and query change